<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>手写一个三角形01-01</title>
  <style>
    div {
      width: 0;
      height: 0;
      margin: 0;
      border: 50px solid transparent;
    }

    div .all {
      border-top: 50px solid red;
      border-left: 50px solid green;
      border-bottom: 50px solid blue;
      border-right: 50px solid yellow;
    }

    div .border-top {border-top: 50px solid red;}
    div .border-left {border-left: 50px solid green;}
    div .border-bottom {border-bottom: 50px solid blue;}
    div .border-right {border-right: 50px solid yellow;}
  </style>
</head>
<body>
  <div>
    <div class="all"></div>
    <hr>
    <div class="border-top"></div>
    <hr>
    <div class="border-left"></div>
    <div class="border-bottom"></div>
    <div class="border-right"></div>
    <div class="line"></div>
  </div>
</body>
</html>